<?php
// +----------------------------------------------------------------------
// | snake
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 http://baiyf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: NickBai <1902822973@qq.com>
// +----------------------------------------------------------------------
namespace app\common\model;

use think\Model;

class ApplyBrokerage extends Model
{
    public function add($data)
    {
        if($brokerage = static::get(['apply_id' => $data['apply_id']])) {
            $brokerage->save($data);
            return $brokerage;
        } else {
            $data['create_time'] = time();
            $data['status'] = 1;
            return self::create($data);
        }
    }
}
